import { createRouter, createWebHistory } from "vue-router";
import login from "../views/login.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      component: login,
    },
    {
      path: "/addCard",
      name: "addCard",
      component: () => import("../views/admin/addCard.vue"),
    },
    {
      path: "/admin",
      name: "admin",
      component: () => import("../views/admin/AboutView.vue"),
      children: [
        {
          path: "/card",
          name: "card",
          component: () => import("../views/admin/card.vue"),
        },
        {
          path: "/qiye",
          name: "qiye",
          component: () => import("../views/admin/qiye.vue"),
        },
        {
          path: "/gongzuo",
          name: "gongzuo",
          component: () => import("../views/admin/gongzuo.vue"),
        },
      ],
    },
  ],
});

export default router;
